//  This file is part of Swordbible - http://www.swordwarrior.net
//  Copyright (C) 2003-2009 Manu Mital mital.manu@gmail.com

//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2, or (at your option)
//  any later version.

//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.

//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software Foundation,
//  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

#pragma once

#include "SwordBibleFonts.h"
#include "AutoRichEditCtrl.h"
#include "afxcmn.h"

// CColorMgr dialog

class CColorMgr : public CDialog
{
	DECLARE_DYNAMIC(CColorMgr)

public:
	CColorMgr(CWnd* pParent = NULL, CSwordBibleFonts * pFont = NULL);
	void UpdatePreview();
	virtual ~CColorMgr();

// Dialog Data
	enum { IDD = IDD_COLORMGR };

protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnButtonTextFont();
	afx_msg void OnButtonVerseColor();
	afx_msg void OnButtonBgcolor();


public:
	CSwordBibleFonts * pF;
	CString sample;
	// main window display options
	CString text_facename;
	int text_facesize;
	CString text_color;
	CString verse_color;
	CString links_color;
	CString bg_color;
	CString strong_color;
	CString morph_color;
	CString fn_color;


	// tooltip display options
	virtual BOOL OnInitDialog();
	CString ConvertToHex(COLORREF rgb);
	CString ToHex(int colorVal);
	CString hexify(int aNum);
	COLORREF ToColorRef(CString string);
	static CString COLORREFtoRTF(COLORREF rgb);
	static COLORREF RTFtoCOLORREF(CString string);
	
	afx_msg void OnBnClickedOk();
	afx_msg void OnLinkColor();
	afx_msg void OnDefaults();
	CAutoRichEditCtrl m_previewRichEdit;
public:
	afx_msg void OnButtonStrong();
public:
	afx_msg void OnButtonMorph();
public:
	afx_msg void OnButtonFn();
};
